package org.nutz.stu.controller;

import org.nutz.ioc.annotation.InjectName;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.stu.dao.StudentDao;
import org.nutz.stu.filter.SessionFilter;
import org.nutz.stu.service.StudentService;

/**
 * @Auther: xiaoyuan
 * @Date: 2019/1/21
 * @Description:
 */
@IocBean
public class LoginController {

    @Inject
    private StudentService studentService;

    @At("/hello")
    @Ok("jsp:jsp.hello")
    @Filters(@By(type=SessionFilter.class, args={"user", "/jsp/hello.jsp"}))
    public String doHello() {
        System.out.println(studentService.getStudentById(1));
        return "Hello Nutz,HAHA";
    }

}
